﻿

namespace CodingMuscles.Text.Regexp
{
    /// <summary>
    /// Builds a pattern representing a set of characters for regular expression to match against 
    /// </summary>
    /// <remarks>
    /// A character set will appear in a regular expression pattern between two braces
    /// </remarks>
    public interface ICharacterSetPatternBuilder
    {
        /// <summary>
        /// Includes a literal character in the pattern
        /// </summary>
        /// <param name="ch">The character to include</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder Include(char ch);

        /// <summary>
        /// Includes a non-printable character in the pattern
        /// </summary>
        /// <param name="value">The value to include</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder Include(ushort value);

        /// <summary>
        /// Includes a character range in the pattern
        /// </summary>
        /// <param name="min">The range minimum value</param>
        /// <param name="max">The range maximum value</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder Include(char min, char max);

        /// <summary>
        /// Includes a literal string in the pattern
        /// </summary>
        /// <param name="str">The string to include</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder Include(string str);

        /// <summary>
        /// Includes a character class in the pattern
        /// </summary>
        /// <param name="class">The class to add</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder Include(CharacterClass @class);

        /// <summary>
        /// Includes a Unicode category in the pattern
        /// </summary>
        /// <param name="categoryName">The name of the category</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder IncludeUnicodeCategory(string categoryName);

        /// <summary>
        /// Excludes a Unicode category in the pattern
        /// </summary>
        /// <param name="categoryName">The name of the category</param>
        /// <returns>A reference to this object after it is modified</returns>
        ICharacterSetPatternBuilder ExcludeUnicodeCategory(string categoryName);
    }
}
